package game.model;

/**
 * @author Amal Al-Ashour
 * This class represents a block in the game board
 */

public class Block {
	private boolean turnedOn; 
	private String imagePath; // path to the image
	public boolean removed; // true: the block is marked as removed
	private int row;
	private int col;
	
	/** Constructor */
	public Block(String image, int r, int c){
		this.imagePath = image;
		row = r;
		col = c;
	}
	
	/** Turn on the block */
	public void turnOn(){
		turnedOn = true;
	}
	
	/** Turn of the block */
	public void turnOff(){
		turnedOn = false;
	}
	
	/** Return the image path of the block */
	public String getImagePath(){
		return imagePath;
	}
	
	/** Return true if the block is turned on; false otherwise */
	public boolean isTurnedOn(){
		return turnedOn;
	}
	
	/** Return true if the block is removed; false otherwise */
	public boolean isRemoved(){
		return removed;
	}
	
	/** Mark the block as removed */
	public void removed(){
		removed = true;
	}
	
	/** Return the row coordinate of the block */
	public int getRow(){
		return row;
	}
	
	/** Return the column coordinate of the block */
	public int getColumn(){
		return col;
	}
	
	/** Return true if this block equals to other block; false otherwise */
	public boolean equals(Object other){
		if (!(other instanceof Block))
			return false;
		Block b = (Block)other;
		return b.imagePath.equals(imagePath);
	}
	
}